{include file="common/header" title="用户列表"}
<div class="layui-body">
	<!-- 内容主体区域 -->

	<div class="layui-box" style="padding: 20px;">
		<button type="button" id="add" class="layui-btn layui-btn-normal">添加用户</button>
	</div>
	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
		<legend>角色列表</legend>
	</fieldset>
	<div style="padding: 30px;">

		<table class="layui-table" lay-skin="line">
			<colgroup>
				<col width="">
				<col width="200">
				<col>
			</colgroup>
			<thead>
				<tr>
					<th>名称</th>
					<th width="50">角色组</th>
					<th width="50">状态</th>
					<th width="140">活跃时间</th>
					<th width="100">操作</th>
				</tr>
			</thead>
			<tbody>
			{volist name="$userList" id="item"}
            <tr>
				<td>{$item['username']}</td>
				<td>{$item['rolename']}</td> 
				<td>{$item['statusname']}</td>
				<td>{$item['activity_at']}</td>
                <td><a  class="edit" data-id="{$item['id']}" data-id="{$item['id']}" data-name="{$item['name']}"><i class="layui-icon layui-icon-edit"></i> 编辑</a></td>
            </tr>
            {/volist}
			</tbody>
		</table>
		<div>{$page|raw}</div>
	</div>
</div> 
<script>
	layui.use(['layer'], function() {
		var layer = layui.layer;
		var $ = layui.jquery;

		$(document).on('click', '#add', function() { 
			layer.open({
				type: 2,
				title: '选择节点',
				area: ['90%', '99%'],
				content: './addUser'
			});
		}) 

		$(document).on('click', '.edit', function() {
			var id = $(this).data('id')
			var name = $(this).data('name')
			layer.open({
				type: 2,
				title: '编辑',
				area: ['90%', '99%'],
				content: './edit?id='+id
			});
		})
	});
</script>
{include file="common/footer"}